//package com.yifushidai.api;
//
//import com.yifushidai.service.IdcardService;
//import com.yifushidai.utils.R;
//import io.swagger.annotations.*;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.http.MediaType;
//import org.springframework.web.bind.annotation.*;
//
//import javax.servlet.http.HttpServletRequest;
//
//@RestController
//@Api(description = "身份证相关接口", tags = "IdcardController")
//@RequestMapping("/api/idcard")
//public class IdcardController {
//
//    @Autowired
//    private IdcardService idcardService;
//
//    @Value("${apartment.idcardreader.mac}")
//    private String apartment_idcardreader_mac;
//
//    @PostMapping("/load")
//    @ApiOperation(value = "身份证录入接口", notes = "向身份证读卡器设备发送录入身份证指令", produces = MediaType.APPLICATION_JSON_VALUE)
//    public R load(HttpServletRequest request) throws Exception {
//        return idcardService.load(apartment_idcardreader_mac, request);
//    }
//
//    @PostMapping("/{gmsfzhm}")
//    @ApiOperation(value = "指定身份证查询接口", notes = "指定公民身份证号码，查询身份证是否录入成功", produces = MediaType.APPLICATION_JSON_VALUE)
//    @ApiImplicitParams({
//            @ApiImplicitParam(paramType = "path", name = "gmsfzhm", value = "公民身份证号码", required = true)
//    })
//    public R selectByGmsfzhm(@PathVariable("gmsfzhm") String gmsfzhm) throws Exception {
//        return idcardService.selectByGmsfzhm(gmsfzhm);
//    }
//
//    @PostMapping("/bind")
//    @ApiOperation(value = "身份证绑定接口", notes = "身份证绑定", produces = MediaType.APPLICATION_JSON_VALUE)
//    public R bind(@ApiParam(value = "联网盒mac", required = true) @RequestParam String mac,
//                  @ApiParam(value = "绑卡类型", required = true) @RequestParam String idcardType,
//                  @ApiParam(value = "身份证UID", required = true) @RequestParam String idcardUid,
//                  @ApiParam(value = "过期时间", required = true) @RequestParam String expireTime,
//                  HttpServletRequest request) throws Exception {
//        return idcardService.bind(mac, idcardType, idcardUid, expireTime, request);
//    }
//
//    @PostMapping("/unbind")
//    @ApiOperation(value = "身份证解绑接口", notes = "身份证解绑", produces = MediaType.APPLICATION_JSON_VALUE)
//    public R unbind(@ApiParam(value = "联网盒mac", required = true) @RequestParam String mac,
//                    @ApiParam(value = "解卡类型", required = true) @RequestParam String idcardType,
//                    HttpServletRequest request) throws Exception {
//        return idcardService.unbind(mac, idcardType, request);
//    }
//
//    @PostMapping("/roomlogout")
//    @ApiOperation(value = "房间注销接口", notes = "房间注销，解绑除管理员外的全部用户", produces = MediaType.APPLICATION_JSON_VALUE)
//    public R roomlogout(@ApiParam(value = "联网盒mac", required = true) @RequestParam String mac,
//                        HttpServletRequest request) throws Exception {
//        return idcardService.roomlogout(mac, request);
//    }
//
//    @PostMapping("/query")
//    @ApiOperation(value = "查询房间绑定的身份证接口", notes = "查询房间绑定的所有身份证信息", produces = MediaType.APPLICATION_JSON_VALUE)
//    public R query(@ApiParam(value = "联网盒mac", required = true) @RequestParam String mac) throws Exception {
//        return idcardService.query(mac);
//    }
//
//}
